<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>办公室：证件信息</title>
	<jsp:include page="/com/common/_js.jsp"></jsp:include>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#file_upload').uploadify({
	        'uploader'  	: 'uploadify/uploadify.swf',
	        'script'    	: 'scanpicAction!uploadScanpic.jspa',
	        'scriptData'	: {'userId':${cookie.userId.value},'ctfId':<s:property value="ctfId"/>}, 
	        'cancelImg' 	: 'uploadify/cancel.png',
	        'fileDataName'	: 'uploadify', 
	        'folder'    	: '/uploads',
	        'auto'      	: true,
	        'onComplete'	: function(event, ID, fileObj, response, data) {
			 	var reqObj = eval('(' + response + ')');
			 	$("<img/>").attr("src","/web"+reqObj.filePath).appendTo($("#right"));
	        }
	      });
	});
	
	function insertCtf(reqObj){

		var obj = new Object();
		obj["picName"] = reqObj.fileName;
		obj["scanpicAddr"] = reqObj.filePath;

		$("#ctfId").each(function(){
			obj[this.name] = $(this).val();
		});
		
		$.post("officer/userAction!login.jspa", obj, function(json) {
			switch (json.state) {
				case "checkCode":{
					alert("验证码错误");
					break;
				}
				case "checkPsw" :{
					alert("用户不存在或密码错误");
					break;
				}
				case "checkRole":{
					alert("没有权限登录");
					break;
				}
				default:{
					window.location.href="com/"+json.state+"/index.jsp";
					break;
				}
			}
		}, "json");
	}
	</script>
</head>
<body>
	<div id="web">
		<div id="head"></div>
		<div id="body">
			<div class="container-fluid">
			    <div class="row-fluid">
				    <div class="span2">
				    <jsp:include page="_left.jsp"></jsp:include>
				    </div>
				    <div class="span10">
				    <div class="left-bar"><i class="icon-folder-close icon-white"></i> 证件信息</div>
				 		<table>
						  <tr>
						    <th>证件ID</th>
						    <th>导游ID</th>
						    <th>证件卡</th>
						    <th>证件</th>
						    <th>颁发日期</th>
						    <th>有效期</th>
						  </tr>
						  <tr>
						    <td><s:property value="ctfId"/><s:hidden id="ctfId" value="%{ctfId}"></s:hidden></td>
						    <td><s:property value="guideId"/></td>
						    <td><s:property value="cardId"/></td>
						    <td><s:property value="cardName"/></td>
						    <td><s:property value="issueDate"/></td>
						    <td><s:property value="ctfDate"/></td>
						  </tr>
						</table>
						<input id="file_upload" type="file" name="file_upload" />
						<s:iterator value="scanpics">
							<img alt="" src="/web<s:property value='scanpicAddr'/>">
						</s:iterator>
				    </div>
			    </div>
			</div>
		</div>
		<div id="foot"></div>
	</div>
</body>
</html>